<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var str1="123456199208241234";
			function replace1 (str,start,length) {
				var s=str.split("");
				for(var i=start;i<start+length;i++){
					s[i]='*';
				}
				return s.join("");
			}
			str1=replace1(str1,6,8);
			console.log(str1);
			
			var str2="666666199208241234";
			str2=str2.replace(str2.substr(6,8),"********");
			console.log(str2);
			
			var str3="666888199208241234";
			str3=str3.replace(/(\d{6})\d{8}(\d{4})/,"$1********$2");
			console.log(str3);
		</script>
	</body>
</html>
